<template>
  <view class="page">
    <view class="main">
    <uni-section title="选择类型" type="line">
      <view class="uni-px-4 uni-pb-4">
        <uni-data-checkbox v-model="type" :localdata="typeList"></uni-data-checkbox>
      </view>
    </uni-section>
    <Form :type="type" @submit="handleSubmit" ref="form"></Form>
  </view>
  <view class="uni-px-4 uni-pb-4">
    <button type="primary" @click="form.submit()">保存方案</button>
  </view>
  </view>
</template>

<script setup>
  import { ref } from 'vue';
  import Form from '@/components/Form/Form.vue';
  console.log('常量:', Form.modal)
  const type = ref(1);
  const typeList = [
    {
      text: '动作跟练',
      value: 1,
    },
    {
      text: '组间休息',
      value: 2,
    }
  ];
  const form = ref();
  const handleSubmit = values => {
    console.log(values)
  }
</script>

<style lang="scss">
  // .page {
  //   height: 100vh;
  //   display: flex;
  //   flex-direction: column;
  //   .main {
  //     flex: 1;
  //   }
  // }
</style>
